<div id="content">
    {switch $type}
    {case 1}
    <div id="title">学生注册</div>
    <div id="user"><a  href="{:url('register')}?type=1" id="chocse">学生</a><a href="{:url('register')}?type=2">教工</a><a href="{:url('register')}?type=3">校外</a></div>
    <div id="student">

        <table>
            <input type="hidden" name="type" value="1">
            <tr><th>学号：</th><td><input type="number" name="stuid"  required onchange="getstuid(this)"></td></tr>
            <tr><th>姓名：</th><td><input type="text" name="name"  required onchange="getname(this)"></td></tr>
            <tr><th>密码：</th><td><input type="password" name="psw" required id="psw" onchange="getpassword(this)"></td></tr>
            <tr><th>确认密码：</th><td><input type="password" required onchange="getpassword2(this)"></td></tr>
            <tr><th>邮箱：</th><td><input type="email" name="email" required></td></tr>
            <tr><th>手机号码：</th><td><input type="number" name="phone" required onchange="getphone(this)"></td></tr>
            <tr><th>系部：</th><td>
                <select style="width: 252px;height: 30px;" id="cho" required onchange="getgrade(this.value);">
                    <option>选择系部</option>
                    {foreach $xibu as $v}
                    <option value="{$v.uid}">{$v.apartment}</option>
                    {/foreach}
                </select>
                <input id="apartment"  name="apartment" type="hidden"/>
            </td></tr>

            <tr><th>年级：</th><td>
                <select id="grade" style="width: 252px;height: 30px;" name="grade" required onchange="getclass(this.value);">
                    <option>选择年级</option>
                    {foreach name="grade" item="v"}
                    <option value="{$v.grade}">{$v.grade}</option>
                    {/foreach}
                </select>
            </td></tr>
            <tr><th>班级：</th><td>
                <select id="class" style="width: 252px;height: 30px;" name="class" required>
                    {/foreach}
                </select>
            </td></tr>
            <tr><th>验证码：</th><td><input type="number" name="captcha"></td></tr>
            <tr><td></td><td> <img src="{:captcha_src()}"  id="img"  alt="captcha" /></td></tr>
            <tr><td></td><td><input  type="button" value="注　册" onclick="register()"></td></tr>
        </table>



    </div>
    {/case}

    {case 2}
    <div id="title">教工注册</div>
    <div id="user"><a  href="{:url('register')}?type=1" >学生</a><a href="{:url('register')}?type=2" id="chocse">教工</a><a href="{:url('register')}?type=3">校外</a></div>
    <div id="student">

        <table>
            <input type="hidden" name="type" value="2">
            <tr><th>姓名：</th><td><input type="text" name="name"  required onchange="getname(this)"></td></tr>
            <tr><th>密码：</th><td><input type="password" name="psw" required id="psw" onchange="getpassword(this)"></td></tr>
            <tr><th>确认密码：</th><td><input type="password"  required onchange="getpassword2(this)"></td></tr>
            <tr><th>邮箱：</th><td><input type="email" name="email" required></td></tr>
            <tr><th>工号：</th><td><input type="number" name="phone" required ></td></tr>
            <tr><th>部门：</th><td>
                <select style="width: 252px;height: 30px;"  id="cho" required onchange="getgrade(this.value);">
                    <option>选择部门</option>
                    {foreach name="apartment" item="v"}
                    <option value="{$v.uid}">{$v.apartment}</option>
                    {/foreach}
                </select>
                <input id="apartment"  name="apartment" type="hidden"/>
            </td></tr>
            <tr><th>验证码：</th><td><input type="number" name="captcha"></td></tr>
            <tr><td></td><td><img src="{:captcha_src()}" id="img"  alt="captcha" /></td></tr>
            <tr><td></td><td><input  type="submit" value="注　册" onclick="register()"></td></tr>
        </table>



    </div>
    {/case}

    {case 3}
    <div id="title">校外注册</div>
    <div id="user"><a  href="{:url('register')}?type=1">学生</a><a href="{:url('register')}?type=2">教工</a><a href="{:url('register')}?type=3"  id="chocse">校外</a></div>
    <div id="student">

        <table>
            <input type="hidden" name="type" value="3">
            <tr><th>姓名：</th><td><input type="text" name="name"  required onchange="getname(this)"></td></tr>
            <tr><th>密码：</th><td><input type="password" name="psw" required id="psw" onchange="getpassword(this)"></td></tr>
            <tr><th>确认密码：</th><td><input type="password"  required onchange="getpassword2(this)"></td></tr>
            <tr><th>邮箱：</th><td><input type="email" name="email" required></td></tr>
            <tr><th>手机号码：</th><td><input type="number" name="phone" required onchange="getphone(this)"></td></tr>
            <tr><th>部门：</th><td><input type="text" name="apartment"></td></tr>
            <tr><th>验证码：</th><td><input type="number" name="captcha"></td></tr>
            <tr><td></td><td><img src="{:captcha_src()}" id="img"  alt="captcha" /></td></tr>
            <tr><td></td><td><input  type="submit" value="注　册" onclick="register()"></td></tr>
        </table>

    </div>
    {/case}
    {/switch}
</div>

